package com.goldwind.chat.controller;

import com.goldwind.chat.service.impl.MessageImpl;
import com.goldwind.pojo.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/message")
public class MessageController {
   @Autowired
   private MessageImpl messageImpl;

   @GetMapping("/all")
    public List<Message> selectAll() {
        return messageImpl.selectAll();
    }

    @PostMapping("/insert")
    public boolean insert(@RequestBody Message msg) {
        return messageImpl.insert(msg);
    }
}
